package com.example.qihuibao.dao

import androidx.room.Database
import androidx.room.RoomDatabase
import com.example.qihuibao.bean.*

@Database(
    entities = [
        RspQueryEnterpriseInfoBean::class,
        Department::class,
        RspQueryEmployInfoBean.Employ::class,
        RspQueryCanteenInfoBean::class,
        RspQueryMealInfoBean::class,
        RspQueryFeesBean::class,
        RspQueryFaceFileBean.FaceFile::class,
        RspQueryOrderInfoBean.Order::class,
        RspQueryPayDetailBean.Pay::class,
        RspUseDetailBean.Use::class,
        RspUseConsumeBean.Deal::class,
        RspETTicketUseConsumeBean.Deal::class,
               ], version = 1)
abstract class MyDatabase : RoomDatabase() {

    companion object {
        lateinit var db: MyDatabase

//        val MIGRATION_1_2 = object : Migration(1, 2) {
//            override fun migrate(database: SupportSQLiteDatabase) {
//                // 执行从旧版本升级到新版本的 SQL 语句
////            database.execSQL("DROP TABLE user")
//            }
//        }
    }

    abstract fun enterpriseInfoDao(): EnterpriseInfoDao
    abstract fun canteenInfoDao(): CanteenInfoDao
    abstract fun mealInfoDao(): MealInfoDao
    abstract fun departmentInfoDao(): DepartmentInfoDao
    abstract fun employInfoDao(): EmployInfoDao
    abstract fun feesInfoDao(): FeesInfoDao
    abstract fun faceFileInfoDao(): FaceFileInfoDao
    abstract fun orderInfoDao(): OrderInfoDao
    abstract fun payInfoDao(): PayInfoDao
    abstract fun useInfoDao(): UseDao
    abstract fun dealDao(): DealDao
    abstract fun etDealDao(): ETDealDao

}

